{extend name="main"}

{block name="button"}
<button data-target-submit class='layui-btn layui-btn-sm'>{:lang('保存数据')}</button>
<button data-target-backup class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="{:lang('确认要取消编辑吗？')}">{:lang('取消编辑')}</button>
{/block}

{block name='content'}
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card" data-table-id="MessageTable">
    <div class="layui-card-body">

        <label class="layui-form-item relative block">
            <span class="help-label"><b>{:lang('通知标题')}</b>Notify Title</span>
            <input class="layui-input" name="name" placeholder="{:lang('请输入通知标题')}" required value='{$vo.name|default=""}'>
        </label>

        <div class="layui-form-item label-required-prev">
            <span class="help-label"><b>{:lang('通知内容')}</b>Notify Content</span>
            <label class="relative block">
                <textarea class="layui-hide" name="content" placeholder="{:lang('请输入通知内容')}">{$vo.content|default=''}</textarea>
            </label>
        </div>

        <div class="hr-line-dashed"></div>
        {notempty name='vo.id'}<input name='id' type='hidden' value='{$vo.id}'>{/notempty}

        <div class="layui-form-item text-center">
            <button class="layui-btn" type="submit">{:lang('保存数据')}</button>
            <button class="layui-btn layui-btn-danger" data-confirm="{:lang('确定要取消编辑吗？')}" type='button' data-target-backup>{:lang('取消编辑')}</button>
        </div>
    </div>
</form>

<script>
    require(['ckeditor'], function () {
        window.createEditor('[name=content]', {height: 530});
    });
</script>
{/block}